home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / PowerPlant / AGA Classes 1.2 / Buttons / LAGAIconDropButton.cp < prev    next >
Encoding:
Text File  |  1996-06-30  |  4.1 KB  |  118 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    LAGAIconDropButton.cp
  3. // ===========================================================================
  4. //    “Apple Grayscale Appearance” compliant (almost) drop icon button
  5. //    Copyright © 1996 Chrisoft (Christophe ANDRES)  All rights reserved.
  6. //
  7. //    You may use this source code in any application (commercial, shareware, freeware,
  8. //    postcardware, etc), but not remove this notice (no need to acknowledge the use of
  9. //    this class in the about box)
  10. //    You may not sell this source code in any form. This source code may be placed on 
  11. //    publicly accessable archive sites and source code disks. It may not be placed on 
  12. //    profit archive sites and source code disks without the permission of the author, 
  13. //    Christophe ANDRES.
  14. //    
  15. //        This source code is distributed in the hope that it will be useful,
  16. //        but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. //        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. //
  19. //    If you make any change or improvement on this class, please send the improved/changed
  20. //    version to : chrisoft@calva.net or Christophe ANDRES
  21. //                                     20, rue Prosper Mérimée
  22. //                                     67100 STRASBOURG
  23. //                                     FRANCE
  24. //
  25. // ===========================================================================
  26. //    LAGAIconDropButton.h    <- double-click + Command-D to see class declaration
  27. //
  28. //    LAGAIconDropButton is a subclass of LAGAIconButton, and enables the button to accept
  29. //        dropped items. To use it, you must subclass it and override ItemIsAcceptable and
  30. //        ReceiveDragItem (defined in LDragAndDrop)
  31. //
  32. //        see the comments in LAGAIconButton.h
  33. //
  34. //        Version : 1.2
  35. //
  36. //        Change History (most recent first, date in US form : mm/dd/yy):
  37. //
  38. //                        06/30/96    ca        Public release of version 1.2
  39. //                        06/04/96    ca        Added static RegisterClass for easier class registration
  40. //                                                        Increased version to 1.2
  41. //                        05/13/96    ca        Increased version to 1.1
  42. //                                                        Added copy constructor
  43. //                                                        Added "on the fly" constructor
  44. //                                                        Added change history
  45. //                        04/22/96    ca        class made available by Christophe ANDRES <chrisoft@calva.net>
  46. //                                                        (version 1.0)
  47. //
  48. //        To Do:
  49. //
  50.  
  51. #include "LAGAIconDropButton.h"
  52.  
  53. //    begin    <06/04/96    ca>
  54. void LAGAIconDropButton::RegisterClass ()
  55.  
  56. {
  57.     URegistrar::RegisterClass(LAGAIconDropButton::class_ID, (ClassCreatorFunc)LAGAIconDropButton::CreateAGAIconDropButtonStream);
  58. }
  59. //    end    <06/04/96    ca>
  60.  
  61. LAGAIconDropButton* LAGAIconDropButton::CreateAGAIconDropButtonStream (LStream *inStream)
  62.  
  63. {
  64.     return(new LAGAIconDropButton(inStream));
  65. }
  66.  
  67. //-------Constructors-------------------------------------------------------------------------------------------------
  68.  
  69. LAGAIconDropButton::LAGAIconDropButton () : LDragAndDrop(UQDGlobals::GetCurrentPort(), this)
  70.  
  71. {
  72. }
  73.  
  74. LAGAIconDropButton::LAGAIconDropButton (LStream    *inStream) :    LAGAIconButton(inStream),
  75.                                                                                                                             LDragAndDrop(UQDGlobals::GetCurrentPort(), this)
  76. {
  77. }
  78.  
  79. //    begin <05/13/96 ca>
  80. LAGAIconDropButton::LAGAIconDropButton (const LAGAIconDropButton &inOriginal) : LAGAIconButton(inOriginal),
  81.                                                                                                                                                                 LDragAndDrop(UQDGlobals::GetCurrentPort(), this)
  82. {
  83. }
  84.  
  85. LAGAIconDropButton::LAGAIconDropButton (const SPaneInfo &inPaneInfo, MessageT inClickedMessage, OSType inIconType,
  86.                                                                                 ResIDT inIconID, Boolean inRadioButtonBehavior)
  87.                                                                             : LAGAIconButton(inPaneInfo, inClickedMessage, inIconType, inIconID, inRadioButtonBehavior),
  88.                                                                                 LDragAndDrop(UQDGlobals::GetCurrentPort(), this)
  89. {
  90. }
  91. //    end <05/13/96 ca>
  92.  
  93. LAGAIconDropButton::~LAGAIconDropButton ()
  94.  
  95. {
  96. }
  97.  
  98. void LAGAIconDropButton::HiliteDropArea (DragReference inDragRef)
  99.  
  100. {
  101.     DrawGraphic(true);
  102.     LDragAndDrop::HiliteDropArea(inDragRef);
  103. }
  104.  
  105. void LAGAIconDropButton::UnhiliteDropArea (DragReference inDragRef)
  106.  
  107. {
  108.     LDragAndDrop::UnhiliteDropArea(inDragRef);
  109.     DrawGraphic(false);
  110. }
  111.  
  112. Boolean LAGAIconDropButton::ItemIsAcceptable (DragReference inDragRef, ItemReference inItemRef)
  113.  
  114. {
  115.     return(true);
  116. }
  117.  
  118.